package service.impl;

import dao.UserDao;
import dao.impl.UserDaoImpl;
import pojo.User;
import service.UserService;

import java.sql.SQLException;

public class UserServiceImpl implements UserService {

    private UserDao userDao = new UserDaoImpl();

    @Override
    public int register(User user) throws SQLException {
        return userDao.saveUser(user);
    }

    @Override
    public User login(User user) throws SQLException {
        return userDao.queryByUsernameAndPassword(user.getUid(),user.getPassword());
    }
}
